home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
vap.arc
/
SAMPLE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1988-04-28
|
2KB
|
84 lines
/*****************************************************************************
*
* Program Name: SAMPLE.VAP
*
* Filename: sample.c
*
* Version: 1.0
*
* Programmers: Bryan Sparks
* API Consulting
* Novell Inc
*
* Files used: sap.c vsetup.asm vsap.lib
*
* Comments: This is a sample VAP.
*
****************************************************************************/
extern int Keyword;
unsigned ConsoleProcess, FirstProcessID, SecondProcessID;
main()
{
int ccode;
void FirstProcessStart();
void SecondProcessStart();
VSpawnProcess( FirstProcessStart );
VSpawnProcess( SecondProcessStart );
/* Notice that I advertise as a NetWare file server. Probably not a */
/* good idea, but it illustrates the use of the SAP and you can do an */
/* SLIST to see you VAP. */
StartSAPOscillationRoutines( "SAMPLE_VAP", 4, 1010 );
ConsoleProcess = VGetProcessID();
VInitializationComplete();
while (1) {
VSleepProcess();
switch (Keyword) {
case 0:
VWakeUpProcess( FirstProcessID );
break;
case 1:
VWakeUpProcess( SecondProcessID );
break;
}
}
}
void FirstProcess()
{
FirstProcessID = VGetProcessID();
VInitializationComplete();
while (1) {
VSleepProcess();
VConsoleError( "First Process is running." );
}
}
void SecondProcess()
{
SecondProcessID = VGetProcessID();
VInitializationComplete();
while (1) {
VSleepProcess();
VConsoleError( "Second Process is running." );
}
}
ConsoleHandler()
{
VWakeUpProcess( ConsoleProcess );
return (0);
}
DownHandler()
{
VPrintString( -1, -1, "Sample VAP is down.\n\r", -1 );
return (0);
}